<div>
	<form id="edit_form" action="/reward/editAndSaveStaff" class="action-ajax-form action-ajax-form-valid"  method="post" enctype="multipart/form-data">
		<div class="detailsBox clearfix">
			<div class="openBox">
				<h3 class="mt20">
					<i class="jtIco"></i>编辑考核人员信息
				</h3>
				<div class="detaiTab">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<td align="right" class="bg" width="18%">姓名:</td>
								<td colspan="3"><input name="userName" id="userName" class="tabInp" type="text" value="${personalInfo.userName}" readonly="readonly"/></td>
								<td align="right" class="bg" width="18%">省区:</td>
								<td colspan="3">
									<select name="provinceCode" id="provinceCode">
										<#if personalInfo.provinceName == ''>
											<option name="defaultProvinceName" id="defaultProvinceName" value="请选择">请选择</option>											
										<#else>
											<option name="defaultProvinceName" id="defaultProvinceName" value="${personalInfo.provinceCode}|${personalInfo.provinceName}">${personalInfo.provinceName}</option>
										</#if>
										<#list provinces as prov>
											<option value="${prov.code}|${prov.name}">${prov.name}</option>								
										</#list>
									</select>
								</td>
							</tr>
							<tr>
								<td align="right" class="bg" width="18%">入职时间:</td>
								<td colspan="3">
									<@date name="joinDate" id="joinDate" class="tabInp" type="text"  value="${personalInfo.joinDate}"/>
								</td>
								<td align="right" class="bg" width="18%">考核月份:</td>
								<td colspan="3"><input name="assesMonth" id="assesMonth" class="tabInp" type="text" value="${personalInfo.assesMonth}" readonly="readonly"/></td>
							</tr>
							<tr>
								<td align="right" class="bg" width="18%">省区所在梯队:</td>
								<td colspan="3">
									<input name="provinceEchelon" id="provinceEchelon" class="tabInp action-valid-field" type="text" value="${personalInfo.provinceEchelon}" data-action-valid-rule="maxlength:3;" />
								</td>
								<td align="right" class="bg" width="18%">起提点(万元):</td>
								<td colspan="3">
									<input name="startRoyaltyPoint" id="startRoyaltyPoint" class="tabInp action-valid-field" type="text" value="${personalInfo.startRoyaltyPoint}" data-action-valid-rule="number;" />
									<span class="action-field-error" for="loanRate" style="color:red;"></span>
								</td>
							</tr>
							<tr>
								<td align="right" class="bg" width="18%">考核类型:</td>
								<td colspan="3">
									<select data-action-valid-rule="required;" name="evaluateType" id="evaluateType"
											class="tabInp action-change-value action-valid-field" 
											data-url="/reward/updateAssesPro" data-action-html="#assesProHtml"  
											data-action-valid-rule="required;" data-action-valid-msg-required="考核类型不能为空！">
											
											<#if dd_no == ''><option>请选择</option>
											<#else><option value="${dd_no}">${dd_name}</option>
											</#if>
										
										<#list dics as dic>
											<option value="${dic.no}">${dic.name}</option>	
										</#list>
									</select>
									<span style="color:red;">*</span>
								</td>
								<td align="right" class="bg" width="18%">考核方案:</td>
								<td id="assesProHtml" class="action-ajax-load" data-action-valid-rule="required;" data-action-valid-msg-required="考核方案不能为空！">
									<select dataSouce="los" name="evaluateScheme" id="evaluateScheme" 
									    class="action-valid-field" data-action-valid-rule="required;" data-action-valid-msg-required="考核方案不能为空！" >
									    <#list lobs as obs>
									    	<option value="${obs[4]}">${obs[5]}</option>
									    </#list>
									</select>
									<span style="color:red;">*</span>
								</td>
							</tr>
							<tr>
								<td align="right" width="15%">当月考核系数:</td>
								<td colspan="3">
									<input name="evaluateCoefficient" id="evaluateCoefficient" class="tabInp action-valid-field" type="text" value="${personalInfo.evaluateCoefficient}" data\-action\-valid\-rule="number;"/>
									<span class="action-field-error" for="loanRate" style="color:red;"></span>
								</td>
								<td>
									<input name="userNo" id="userNo" type="hidden" value="${personalInfo.userNo}"/>
									<input name="userCode" id="userCode" type="hidden" value="${personalInfo.userCode}"/>
								</td>
								<td colspan="3">&nbsp;</td>
							</tr>
							<tr>
								<td class="bg"></td>
								<td colspan="3">
									<@permission permissionName="rewardEditsavePerInfo">
										<input type="submit" value="保存" class="btn_auto_30 btn_blue"/>
									</@permission>
								</td>
								<td>
									<@permission permissionName="rewardEditConfirmPerInfo">
										<input type="button" class="btn_auto_30 btn_red" onclick="saveAndConfirm()" value="保存并确认"/>
									</@permission>	
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
	function saveAndConfirm() {
		$("#edit_form").attr("action" , "/reward/editAndConfirmStaff");
		var provinceEchelon = document.getElementById("provinceEchelon").value;
		var startRoyaltyPoint = document.getElementById("startRoyaltyPoint").value;
		var evaluateCoefficient = document.getElementById("evaluateCoefficient").value;
		if(provinceEchelon == ''){
			alert('省区梯队不能为空');
			return;
		}
		if(startRoyaltyPoint == ''){
			alert('起提点不能为空');
			return;
		}
		if(evaluateCoefficient == ''){
			alert('考核系数不能为空');
			return;
		}
		$("#edit_form").submit();
		$("#edit_form").attr("action" , "/reward/editAndSaveStaff");
	}
</script>
